#define __display_c

#include    "includeAll.h"

code const uint8_t displayFonts[10] =
{
    0x3f,  /*0*/
    0x06,  /*1*/
    0x5b,  /*2*/
    0x4f,  /*3*/
    0x66,  /*4*/
    0x6d,  /*5*/
    0x7d,  /*6*/
    0x07,  /*7*/
    0x7f,  /*8*/
    0x6f,  /*9*/
};

void DisplayScan(void)
{

    displayBuffer[0]   =0x00  ;
    displayBuffer[1]   =0x00  ;
    displayBuffer[2]   =0x00  ;
    displayBuffer[3]   =0x00  ;
    displayBuffer[4]   =0x00  ;
    displayBuffer[5]   =0x00  ;
    displayBuffer[6]   =0x00  ;
    displayBuffer[7]   =0x00  ;
    displayBuffer[8]   =0x00  ;
    displayBuffer[9]   =0x00  ;
    displayBuffer[10]  =0x00  ;
    displayBuffer[11]  =0x00  ;
    displayBuffer[12]  =0x00  ;
    displayBuffer[13]  =0x00  ;
    displayBuffer[14]  =0x00  ;
	displayBuffer[15]  =0x00  ;
    displayBuffer[16]  =0x00  ;
    displayBuffer[17]  =0x00  ;
    displayBuffer[18]  =0x00  ;
    displayBuffer[19]  =0x00  ;
    displayBuffer[20]  =0x00  ;
    displayBuffer[21]  =0x00  ;
    displayBuffer[22]  =0x00  ;
    displayBuffer[23]  =0x00  ;
    curTempH=curTemp/10;
    curTempL=curTemp%10;
    setShiJiWenDu;
    setCurTempFlag;
    d_seg=displayFonts[curTempH];
    if(f_seg_a)    {set_led_9a;  set_led_9b;set_led_9c;set_led_9d;}
    if(f_seg_b)    {set_led_9d;  set_led_9e;set_led_9f,set_led_9g;}
    if(f_seg_c)    {set_led_9g;  set_led_9h;set_led_11h;set_led_11c;}
    if(f_seg_d)    {set_led_11c;  set_led_11b;set_led_11a;set_led_10h;}
    if(f_seg_e)    {set_led_10h;  set_led_10g;set_led_10f;set_led_10c;}
    if(f_seg_f)    {set_led_10c;  set_led_10b;set_led_10a;set_led_9a;}
    if(f_seg_g)    {set_led_10c;  set_led_10d;set_led_10e;set_led_9g;}

    d_seg=displayFonts[curTempL];
    if(f_seg_a)    {set_led_12a;  set_led_12b;set_led_12c;set_led_12d;}
    if(f_seg_b)    {set_led_12d;  set_led_12e;set_led_12f,set_led_12g;}
    if(f_seg_c)    {set_led_12g;  set_led_12h;set_led_13h;set_led_11g;}
    if(f_seg_d)    {set_led_11g;  set_led_11f;set_led_11e;set_led_11d;}
    if(f_seg_e)    {set_led_11d;  set_led_13g;set_led_13f;set_led_13c;}
    if(f_seg_f)    {set_led_13c;  set_led_13b;set_led_13a;set_led_12a;}
    if(f_seg_g)    {set_led_13c;  set_led_13d;set_led_13e;set_led_12g;}

    setTempH=setCurTemp/10;
    setTempL=setCurTemp%10;
    setSheZhiWenDu;
    setTempFlag;
	
	
	
    d_seg=displayFonts[setTempH];
    if(f_seg_a)   {set_led_1a;               }
    if(f_seg_b)   {set_led_1b;               }
    if(f_seg_c)   {set_led_1c; set_led_1d;   }
    if(f_seg_d)   {set_led_1e;               }
    if(f_seg_e)   {set_led_1f;               }
    if(f_seg_f)   {set_led_1h;set_led_1g;    }
    if(f_seg_g)   {set_led_3h;               }

    d_seg=displayFonts[setTempL];
    if(f_seg_a)   {set_led_2a;             }
    if(f_seg_b)   {set_led_2b;             }
    if(f_seg_c)   {set_led_2c;set_led_2d;  }
    if(f_seg_d)   {set_led_2e;             }
    if(f_seg_e)   { set_led_2f;            }
    if(f_seg_f)   {set_led_2g; set_led_2h; }
    if(f_seg_g)   { set_led_5h;            }





    switch(yuYueNum)
    {
    case 0:
    case 1:
    case 2:

    clockHourH=mainClockHour/10;
    clockHourL=mainClockHour%10;
    clockMinH =mainClockMin/10;
    clockMinL =mainClockMin%10;
    setClock;

    break;



    case 3:
    case 4:
    clockHourH = orderClockOpenHour/10;
    clockHourL = orderClockOpenHour%10;
    clockMinH =  orderClockOpenMin/10;
    clockMinL =  orderClockOpenMin%10;
    setDingShiKai;
    break;


    case 5:
    case 6:
    clockHourH	=orderClockCloseHour/10;
    clockHourL	=orderClockCloseHour%10;
    clockMinH 	=orderClockCloseMin/10;
    clockMinL =	orderClockCloseMin%10;
    setDingShiGuan;
    break;

    }


    d_seg=displayFonts[clockHourH];
    if(f_seg_a)    set_led_3a;
    if(f_seg_b)    set_led_3b;
    if(f_seg_c)    set_led_3c;
    if(f_seg_d)    set_led_3d;
    if(f_seg_e)    set_led_3e;
    if(f_seg_f)    set_led_3f;
    if(f_seg_g)    set_led_3g;

    d_seg=displayFonts[clockHourL];
    if(f_seg_a)    set_led_4a;
    if(f_seg_b)    set_led_4b;
    if(f_seg_c)    set_led_4c;
    if(f_seg_d)    set_led_4d;
    if(f_seg_e)    set_led_4e;
    if(f_seg_f)    set_led_4f;
    if(f_seg_g)    set_led_4g;


    d_seg=displayFonts[clockMinH];
    if(f_seg_a)    set_led_5a;
    if(f_seg_b)    set_led_5b;
    if(f_seg_c)    set_led_5c;
    if(f_seg_d)    set_led_5d;
    if(f_seg_e)    set_led_5e;
    if(f_seg_f)    set_led_5f;
    if(f_seg_g)    set_led_5g;

    d_seg=displayFonts[clockMinL];
    if(f_seg_a)    set_led_6a;
    if(f_seg_b)    set_led_6b;
    if(f_seg_c)    set_led_6c;
    if(f_seg_d)    set_led_6d;
    if(f_seg_e)    set_led_6e;
    if(f_seg_f)    set_led_6f;
    if(f_seg_g)    set_led_6g;


    setReShuiLiang;
	setReShuiLiang1;
	
	if(curTemp>30)
	{
		
	if(curTemp<=40)
	{
		setReShuiLiang2;
			
	}
	else if(curTemp<=50)
	{
		setReShuiLiang2;
		setReShuiLiang3;
		
	}
	else if(curTemp<=60)
	{
		setReShuiLiang2;
		setReShuiLiang3;
		setReShuiLiang4;
		
	}
	else if(curTemp<=70)
	{
		
		setReShuiLiang2;
		setReShuiLiang3;
		setReShuiLiang4;
		setReShuiLiang5;
	}
	else 
	{
	
		setReShuiLiang2;
		setReShuiLiang3;
		setReShuiLiang4;
		setReShuiLiang5;
		setReShuiLiang6;
	}
	}
    
    if(bShouDong==0)
	{
		
    if(bShengDian)
    {
        if(flashFalg<=0)
        {
            setShengDian;
        }
    }
	
    if(bZengRong)
    {
        if(flashFalg<=0)
        {
            setZengRong;
        }
    }
	
    if(bFlashShengDian)
    {
        clrShengDian;
        if(bSecFlash500ms)
        {
            setShengDian;
        }
    }
	
    if(bFlashZengRong)
    {
        clrZengRong;
        if(bSecFlash500ms)
        {
            setZengRong;
        }

    }
	}

	if(bFengGuYeDian)
	{
		setFengGuYeDian;
	}
    if((bPowerOnOff)&&(bOrderOpen==0))
    {
		
        if((bSaveTemp==0)&&(bDuanDian==0))
        {
          setBaoWen;
		if(bSecFlash500ms)
		{
				setJiaRe;
		}
	
            switch(huaSaNum)
            {
            case 0:
                setHuaSa1 ;

                break;
            case 1:
                setHuaSa1 ;
                setHuaSa2 ;
                break;
            case 2:
                setHuaSa1 ;
                setHuaSa2 ;
                setHuaSa3 ;
                break;
            case 3:
                setHuaSa1 ;
                setHuaSa2 ;
                setHuaSa3 ;
                setHuaSa4 ;
                break;
            }
            switch(quanNum)
            {
            case 1:
                setQuan1;

                break;
            case 2:
                setQuan1;
                setQuan2;
                break;
            case 3:
				setQuan1;
				setQuan2;
				setQuan3;
                break;
            case 4:
				setQuan1;
				setQuan2;
				setQuan3;
				setQuan4;
                break;
            case 5:
				setQuan1;
				setQuan2;
				setQuan3;
				setQuan4;
				setQuan5;

                break;
            case 6:
				setQuan1;
				setQuan2;
				setQuan3;
				setQuan4;
				setQuan5;
				setQuan6;
                break;
            case 7:
				setQuan1;
				setQuan2;
				setQuan3;
				setQuan4;
				setQuan5;
				setQuan6;
				setQuan7;
                break;
            case 8:
				setQuan1;
				setQuan2;
				setQuan3;
				setQuan4;
				setQuan5;
				setQuan6;
				setQuan7;
				setQuan8;
                break;
            case 9:
				setQuan1;
				setQuan2;
				setQuan3;
				setQuan4;
				setQuan5;
				setQuan6;
				setQuan7;
				setQuan8;
				setQuan9;
                break;
			case 10:
				setQuan1;
				setQuan2;
				setQuan3;
				setQuan4;
				setQuan5;
				setQuan6;
				setQuan7;
				setQuan8;
				setQuan9;
				setQuan10;
			break;
            }
        }
        else
        {
			setJiaRe;
		if(bSecFlash500ms)
		{
				setBaoWen;
		}
			setQuan1;
			setQuan2;
			setQuan3;
			setQuan4;
			setQuan5;
			setQuan6;
			setQuan7;
			setQuan8;
			setQuan9;
			setQuan10;
            setHuaSa1 ;
            setHuaSa2 ;
            setHuaSa3 ;
            setHuaSa4 ;
        }
    }
	if(bOrderOpen==1)
	{
			setJiaRe;
		if(bSecFlash500ms)
		{
				setBaoWen;
		}
			setQuan1;
			setQuan2;
			setQuan3;
			setQuan4;
			setQuan5;
			setQuan6;
			setQuan7;
			setQuan8;
			setQuan9;
			setQuan10;
            setHuaSa1 ;
            setHuaSa2 ;
            setHuaSa3 ;
            setHuaSa4 ;
	}
    if(bSecFlash500ms)
    {
        setClockFlag;
    }
    else
    {
        clrClockFlag;
    }
	if(flashYuYue<=0)
	{
		if((bOrderOpen)||(bOrderClose))
		{
			 setDingShiKai;
			 setDingShiGuan;
		}
	}
    // if(flashSetMode<=0)
    // {

        // if(bOrderCycle)
        // {
            // setDingShiKai;
            // setDingShiGuan;
        // }
        // else
        // {
            // if(bOrderClose)
            // {
                // setDingShiGuan;
            // }
            // if(bOrderOpen)
            // {
                // setDingShiKai;
            // }
        // }
    // }

}


